<!--
 * @Author: xuhy 1727317079@qq.com
 * @Date: 2022-09-15 20:12:24
 * @LastEditors: xuhy 1727317079@qq.com
 * @LastEditTime: 2022-09-16 11:22:29
 * @FilePath: \vue3_test\src\components\SonOne.vue
 * @Description: 子组件
-->
<template>
  <div class="child">
    <h3>我是Child组件</h3>
    {{ sum }}
  </div>
</template>

<script>
import { ref } from "vue";
export default {
  name: "ChildOne",
  async setup() {
    let sum = ref(0);

    let p = new Promise((resolve, reject) => {
      setTimeout(() => {
        resolve({ sum });
      }, 1000);
    });
    return await p;
  },
};
</script>

<style>
.child {
  background-color: skyblue;
  padding: 10px;
}
</style>
